Skip to content

Release R2.2.0#114

Merged
evolve75 merged 11 commits intomasterfrom
next
Feb 6, 2026
Merged

Release R2.2.0#114
evolve75 merged 11 commits intomasterfrom
next

Conversation

@evolve75
Copy link
Owner

@evolve75 evolve75 commented Feb 6, 2026

Release R2.2.0

Summary of changes:

  • Prevent cycles by rejecting attempts to add an ancestor as a child.
  • Ensure remove_all! detaches children by clearing parent links.
  • Guard rename_child against sibling name collisions.
  • Harden binary child assignment (set_child_at) with proper index errors and cleanup.
  • Make traversals resilient to missing children by skipping nils in postorder/breadth.
  • Fix each_level to return a level-wise enumerator when no block is given.
  • Improve to_s to show <Empty> for nil content.
  • Bump version to 2.2.0 and update History/API-CHANGES.

Tag: R2.2.0

- Updated the version to 2.1.2pre
- Linked the Github repository in the metadata (for Github packages)
Ensure children become true roots after remove_all! by clearing their parent
links. This matches the method's contract and prevents stale parent
references from corrupting later traversal or metrics.
Raise when renaming a child to an existing sibling name to prevent overwriting
entries in the children hash. This avoids orphaning nodes and keeps child
lookup consistent.
Fix set_child_at index errors and clean up parent/hash references
when replacing or clearing children. This preserves swap semantics and
avoids stale lookups.
Skip nil children during postorder and breadth-first traversals so binary
nodes with missing children do not break traversal. Add a regression test
covering nil child traversal paths.
Return a level-wise enumerator when no block is given and add a test to
assert the yielded level arrays match the tree structure.
Render '<Empty>' when a node has nil content and add tests for both
nil and non-nil content values.
Add a new 2.2.0 section covering recent behavior changes in tree
operations and traversal, plus link references for the new entries.
Bump the gem version to 2.2.0 and record the 2.2.0 changes in the
project history.
@evolve75 evolve75 merged commit 97f5bdc into master Feb 6, 2026
23 checks passed
@coveralls
Copy link

Coverage Status

coverage: 96.35% (+1.9%) from 94.416%
when pulling 7d76c8e on next
into f99daed on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants